<?php
/*
 * description：
 * author：wh
 * email：
 * createTime：{2019/11/10} {14:54} 
 */

namespace app\middleware;


use libraries\systemlogs\SysRequestLog;
use libraries\Tools;

class Request
{
    protected $start_time = 0;
    protected $request = null;

    public function handle($request, \Closure $next){
        $this->start_time = Tools::getMillisecond();
        $this->request = $request;
        return $next($request);
    }

    public function end(\think\Response $response)
    {

        SysRequestLog::add($this->start_time);
    }
}